<link href="./assets/admin/css/schedule/css/schedule.css"
	rel="stylesheet" type="text/css" />
<h3 class="page-title">
   	 资源排期
</h3>

<div class="table-custom" >
	<tabset>
        <tab ng-repeat="tab in tabs" heading="{{tab.name}}" ng-click="initTab(tab.idx);">
            <div ng-include="tab.url"></div>
        </tab>
    </tabset>
    
    <div ed-modal="resourceInfoModal" data-options="title:'媒体资源信息',icon:'fa-bus',static:true,width:'900px',defaultButton:false">
	    <div style="padding: 5px;width: 100%;overflow: auto;height:500px;">
			<div class="portlet">
				<div class="portlet-body">
					<tabset>
						<tab heading="资源明细">
				            <div class="portlet">
				            	<div class="portlet-body">
									<form action="#" class="form-horizontal form-row-seperated w5c-form">
						        		<div class="form-body">
				                        	<div class="row">
				                        		<div class="col-md-12">
					                        		<div class="form-group">
					                                	<label class="col-md-3 control-label">编号：</label>
						                                <div class="col-md-8">
						                                	<p class='form-control-static'>{{resourceInfoModal.resource.resourceCode}}</p>
						                                </div>
					                            	</div>
				                        		</div>
				                        	</div>
				                        	<div class="row">
				                        		<div class="col-md-12">
					                        		<div class="form-group">
					                                	<label class="col-md-3 control-label">规格：</label>
						                                <div class="col-md-8">
						                                	<p class='form-control-static'>{{resourceInfoModal.resource.model}}</p>
						                                </div>
					                            	</div>
				                        		</div>
				                        	</div>
				                        	<div class="row">
				                        		<div class="col-md-12">
					                        		<div class="form-group">
					                                	<label class="col-md-3 control-label">级别：</label>
						                                <div class="col-md-8">
						                                	<p class='form-control-static'>{{resourceInfoModal.resource.resourceLevel | code:'RESOURCE_LEVEL'}}</p>
						                                </div>
					                            	</div>
				                        		</div>
				                        	</div>
				                        	<div class="row" ng-repeat="item in resourceInfoModal.resource.mediaItems">
				                        		<div class="col-md-12">
					                        		<div class="form-group">
					                                	<label class="col-md-3 control-label">{{item.itemName}}：</label>
						                                <div class="col-md-8">
						                                	<p class='form-control-static'>{{resourceInfoModal.resource[item.itemId]}}</p>
						                                </div>
					                            	</div>
				                        		</div>
				                        	</div>
				                        	<div class="row">
				                        		<div class="col-md-12">
					                        		<div class="form-group">
					                                	<label class="col-md-3 control-label">照片：</label>
						                                <div class="col-md-8">
						                                	<img id="resourceImgViewArea" alt="图片无法显示" src="" style="width: 200px;height: 200px;">
						                                </div>
					                            	</div>
				                        		</div>
				                        	</div>
				                        </div>
				            		</form>	
								</div>
				            </div>
				        </tab>
						<tab heading="广告刊载">
				            <div class="portlet">
				            	<div class="portlet-body">
									<table ed-grid="resourceAdsGrid" ed-url="media/resource/ads.do"class="table table-striped table-bordered table-hover dataTable" style="width: 100%;">
										<thead>
							                <tr>
							                    <th ed-data="_index"></th>
							                    <th ed-data="content">广告内容</th>
							                    <th ed-data="customerName">经营单位</th>
							                    <th ed-data="publishTime">广告起始时间</th>
							                    <th ed-data="publishOffTime">广告终止时间</th>
							                </tr>
							            </thead>
									</table>
								</div>
				            </div>
				        </tab>
						<tab heading="经营权属">
				            <div class="portlet">
				            	<div class="portlet-body">
									<table ed-grid="resourceRightsGrid" ed-url="media/resource/rights.do" class="table table-striped table-bordered table-hover dataTable" style="width: 100%;">
										<thead>
							                <tr>
							                    <th ed-data="_index"></th>
							                    <th ed-data="contractNo">合同编号</th>
							                    <th ed-data="customerName">经营单位</th>
							                    <th ed-data="startDate">经营起始时间</th>
							                    <th ed-data="endDate">经营终止时间</th>
							                </tr>
							            </thead>
									</table>
								</div>
				            </div>
				        </tab>
				    </tabset>
				</div>
			</div>
	    </div>
	</div>
	

    
    <!-- 排期明细 -->
	<div ed-tips="scheduleInfoTip" data-options="direction:'left',height:'220px'">
		<div style="padding: 7px 0px">
			<div style="font-size: 28px; height: 40px; line-height: 40px;border-bottom:1px solid lightgray">
				{{scheduleInfoTip.scheduleData.resourceCode}}
			</div>
			<div style="color: #999">
				<div style="padding: 4px;">经营单位：{{scheduleInfoTip.scheduleData.schedule.contract.customerName}}</div>
				<div style="padding: 4px;">
					合同编号：<a href="javascript:void(0)"
						ng-click="scheduleInfoTip.showContract()">{{scheduleInfoTip.scheduleData.schedule.contract.contractNo}}</a>
				</div>
				
				<div style="padding: 4px;">
					上刊单号：<a href="javascript:void(0)"
						ng-click="billResourcModel.showBillRes()">{{scheduleInfoTip.scheduleData.schedule.bill.billNo}}</a>
				</div>
				<div style="padding: 4px;">
					广告内容：<a href="javascript:void(0)" ng-click="imgModel.showImg(scheduleData.schedule)">{{scheduleInfoTip.scheduleData.schedule.bill.content}}</a>
				</div>
				<div style="padding: 4px;">
					竞价编号：{{scheduleInfoTip.scheduleData.schedule.bid.bidCode}}
				</div>
			</div>
		</div>
	</div>

	<div ed-modal="adInfoModel"
		data-options="title:'广告内容',icon:'fa-bus',static:true,width:'900px',defaultButton:false">
		<div class="form" style="overflow: auto; height: 500px;">
			<div style="padding: 7px 0px 7px 0; height: 100%;">
				<img id="contentImgArea" src="" height="100%" width="100%"
					style="clear: both; display: block; margin: auto; text-align: center" />
			</div>
		</div>
	</div>
	
	<div ed-modal="contractResourceModel" data-options="title:'合同明细',width:'1000px', static:true,icon: 'glyphicon glyphicon-briefcase',defaultButton:false">
	    <div class="form" style="overflow: auto;height: 500px;">
	            <form action="#" class="form-horizontal form-row-seperated">
	                <div class="form-body">
	                	<div class="row">
	                    	<div class="col-md-6">
			                    <div class="form-group">
			                        <label class="col-md-4 control-label">合同编号：</label>
			                        <div class="col-md-8">
			                        	<p class='form-control-static'>{{contractResourceModel.contract.contractNo}}</p>
			                        </div>
			                    </div>
			              	</div>
			              	<div class="col-md-6">
			                    <div class="form-group">
			                        <label class="col-md-3 control-label">合同类型：</label>
			                        <div class="col-md-8">
			                        	<p class='form-control-static'>{{contractResourceModel.contract.sourceType | code : 'sourceType'}}</p>
			                        </div>
			                    </div>
			              	</div>
		           		</div>
		           		
		           		<div class="row">
	                    	<div class="col-md-6">
			                    <div class="form-group">
			                        <label class="col-md-4 control-label">客户名称：</label>
			                        <div class="col-md-8">
			                        	<p class='form-control-static'>{{contractResourceModel.contract.customer.customerName}}</p>
			                        </div>
			                    </div>
			              	</div>
			              	<div class="col-md-6">
			                    <div class="form-group">
			                        <label class="col-md-3 control-label">合同日期：</label>
			                        <div class="col-md-8">
			                        	<p class='form-control-static'>{{contractResourceModel.contract.contractDate}}</p>
			                        </div>
			                    </div>
			              	</div>
		           		</div>
		           		<div class="row">
	                    	<div class="col-md-6">
			                    <div class="form-group">
			                        <label class="col-md-4 control-label">合同金额：</label>
			                        <div class="col-md-8">
			                        	<p class='form-control-static'>{{contractResourceModel.contract.contractAmount}}(￥)</p>
			                        </div>
			                    </div>
			              	</div>
		           		</div>
	                </div>
	            </form>
	      	<div class="portlet" style="margin: 0px 5px 20px 5px;">
	            <div class="portlet-body" style="font-size: 9px;">
	                <div ng-repeat="info in contractResourceModel.contract.mediasMap.elements">
	                	<span style="font-weight: bold;">{{info.value.parentMedia == 1 ? '车辆媒体' : '站点媒体'}}-{{info.value.mediaName}}：</span>
	                	<table ng-if="info.value.parentMedia == 1" class="table table-striped table-bordered table-hover dataTable" style="width: 100%;font-size: 9px;">
		                    <thead>
			                    <tr style="">
			                        <th style="text-align: center;width: 3%;"></th>
			                        <th style="text-align: center;font-weight: bold;width: 16%;">线路</th>
			                        <th style="text-align: center;font-weight: bold;width: 16%;">车牌号</th>
			                        <th style="text-align: center;font-weight: bold;width: 16%;">资源编号</th>
			                        <th style="text-align: center;font-weight: bold;width: 20%;">规格</th>
			                        <th style="text-align: center;font-weight: bold;width: 11%;">开始日期</th>
			                        <th style="text-align: center;font-weight: bold;width: 11%;">结束日期</th>
			                    </tr>
		                    </thead>
	                    	<tbody>
						         	 <tr style="text-align: center;" role="row" ng-repeat="resource in info.value.data">
			                            <td>{{$index + 1}}</td>
			                            <td>{{resource.lineNo}}</td>
			                            <td>{{resource.plateNo}}</td>
				                        <td>{{resource.resourceCode}}</td>
				                        <td>{{resource.model}}</td>
				                        <td>{{resource.startDate | limitTo : '10'}}</td>
				                        <td>{{resource.endDate | limitTo : '10'}}</td>
			                        </tr>
							</tbody> 
	                	</table>
	                	<table ng-if="info.value.parentMedia == 2" class="table table-striped table-bordered table-hover dataTable" style="width: 100%;font-size: 9px;">
		                    <thead>
			                    <tr>
			                        <th style="text-align: center;width: 3%;"></th>
			                        <th style="text-align: center;font-weight: bold;width: 12px;">街道</th>
			                        <th style="text-align: center;font-weight: bold;width: 12px;">站点名称</th>
			                        <th style="text-align: center;font-weight: bold;width: 12px;">行向</th>
			                        <th style="text-align: center;font-weight: bold;width: 12px;">资源编号</th>
			                        <th style="text-align: center;font-weight: bold;width: 20%;">规格</th>
			                        <th style="text-align: center;font-weight: bold;width: 11%;">开始日期</th>
			                        <th style="text-align: center;font-weight: bold;width: 11%;">结束日期</th>
			                    </tr>
		                    </thead>
	                    	<tbody>
						         	 <tr style="text-align: center;" role="row" ng-repeat="resource in info.value.data">
			                            <td>{{$index + 1}}</td>
			                            <td>{{resource.roadName}}</td>
				                        <td>{{resource.stopName}}</td>
				                        <td>{{resource.direction}}</td>
				                        <td>{{resource.resourceCode}}</td>
				                        <td>{{resource.model}}</td>
				                        <td>{{resource.startDate | limitTo : '10'}}</td>
				                        <td>{{resource.endDate | limitTo : '10'}}</td>
			                        </tr>
							</tbody> 
	                	</table>
	                </div>
	            </div>
	        </div>
	    </div>
	</div>

	

	<div ed-modal="billResourcModel"
		data-options="width:'900px',static:true,title: '上刊明细', icon: 'glyphicon glyphicon-briefcase',defaultButton:false">
		<div class="table-custom">
			<div class="portlet" style="height: 500px">
				<div class='ui-ctrl ui-searchbox'>
					<div class='ui-ctrl ui-textbox'>
						<input type='text' value='' placeholder='资源名称...'
							style='width: 180px; height: 19px;' maxlength='100'
							ng-model="billDetailsGrid.query.resourceName" />
					</div>
					<span class='ui-ctrl ui-button ui-searchbox-button'
						ng-click="billDetailsGrid.query()">搜索</span>
				</div>

				<div class="portlet-body" style="width: 100%">
					<table ed-grid="billDetailsGrid"
						class="table table-striped table-bordered table-hover dataTable"
						ed-url="schedule/queryBillResource.do"
						ed-model="billDetail" style="width: 99.5%; margin-left: 2px;">
						<thead>
							<tr>
								<th ed-data="resourceName">资源名称</th>
								<th ed-data="content">内容</th>
								<th ed-data="startDate">开始日期</th>
								<th ed-data="endDate">结束日期</th>
								<th ed-data="publishTime">上刊时间</th>
								<th ed-data="publishOffTime">下刊时间</th>
							</tr>
						</thead>
					</table>
				</div>
			</div>
		</div>
	</div>
</div>


